package miss.sheffield;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 *
 * @author Kevin Doyle
 */
public class Controller {

    private SheffieldFileInitDataReader sheffieldFileInitDataReader;
    private Double[] array = null;
    Double test;
    GPSPoint wp;
    List<GPSPoint> lwp=new ArrayList();

    public Controller() {
        sheffieldFileInitDataReader = new SheffieldFileInitDataReader();
        array = sheffieldFileInitDataReader.getMissionData();
        generatePatrolCourse();
    }

    public static void main(String[] args) {
        Controller sheffield = new Controller();
        
        
    }

    private void generatePatrolCourse() {
        
        for (int i = 0; i < array.length; i += 3) {
            if (array[i] == null) {
                continue;//this trims off the empty array locations
            }

            wp = new GPSPoint(array[i], array[i + 1]);
            lwp.add(wp);
           
        }
        for (Iterator<GPSPoint> it = lwp.iterator(); it.hasNext();) {
            GPSPoint f = it.next();
            System.out.println(f.toString());
        }
    }
}
